<template>
	<view class="content">
		<view class="cont">
			<view class="title">订单查询</view>
			<view class="line">
				<input type="text" v-model="cardNo" class="lineInput" placeholder="请输入提货券编号">
			</view>
			
		</view>
		<view class="SubmitBtnBOx">
			<view class="SubmitBtn" @click="SubmitBtn">立即查询</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cardNo: '',
				
			}
		},
		onLoad() {

		},
		methods: {
           SubmitBtn(){
			   if(!this.cardNo){
			   	uni.showToast({
			   		 title: '请输入提货券编号',
			   		 icon:'none',
			   		 duration: 3000
			   	});
			   	return false
			   }
			   uni.showLoading({
			   	title: '加载中'
			   });
			   this.$http('delivery/cardOrders/list',{
			   	cardNo:this.cardNo,
				pageSize:99
			   },'GET').then(res => {
			   	    uni.hideLoading();
			   	   
			   		if(!res.rows.length){
			   			uni.showToast({
			   				 title: '请输入正确的券码',
			   				 icon:'none',
			   				 duration: 3000
			   			});
			   		}else{
			   			 uni.navigateTo({
			   				url: '../index/orderList?cardNo='+this.cardNo
			   			}); 
			   		}
			    })
		   }
		}
	}
</script>

<style scoped>
	.cont{
		background: #fff;
		padding: 20rpx;
	}
	.title{
		color: #333333;
		font-size: 30rpx;
		border-bottom: #eeeeee 1px solid;
		padding-bottom: 20rpx;
	}
	.lineInput{
		height: 80rpx;line-height: 80rpx;
		padding-left: 20rpx;
		border: 1px solid #D7D7D7;
		border-radius: 10rpx;
		font-size: 28rpx;
	}
	.line{
		padding: 20rpx 0;
	}
	.SubmitBtn{
		height: 90rpx;
		text-align: center;
		line-height: 90rpx;
		font-size: 30rpx;
		background: #D53533;
		color: #fff;
		margin-top: 50rpx;
		border-radius: 10rpx;
	}
	.SubmitBtnBOx{
		padding: 20rpx;
	}
</style>
